Telegram Group & Telegram Channel
🐍 Задача для собеседования на Python

Условие:
def mystery(x, y):
if x == 0:
return y
else:
return mystery(x - 1, x + y)

result = mystery(3, 2)
print(result)

— Вопрос: что будет выведено в результате выполнения этого кода?

Варианты ответов:
А. 5
B. 8
C. 11
D. Ошибка рекурсии

Правильный ответ: B.

Пояснение:
Функция
mystery — это рекурсивная функция, которая накапливает сумму чисел от x до 1, прибавляя y в конце.

@python_job_interview



tg-me.com/python_job_interview/1128
Create:
Last Update:

🐍 Задача для собеседования на Python

Условие:

def mystery(x, y):
if x == 0:
return y
else:
return mystery(x - 1, x + y)

result = mystery(3, 2)
print(result)

— Вопрос: что будет выведено в результате выполнения этого кода?

Варианты ответов:
А. 5
B. 8
C. 11
D. Ошибка рекурсии

Правильный ответ: B.

Пояснение:
Функция
mystery — это рекурсивная функция, которая накапливает сумму чисел от x до 1, прибавляя y в конце.

@python_job_interview

BY Python вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_job_interview/1128

View MORE
Open in Telegram


Python вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

How Does Bitcoin Mining Work?

Bitcoin mining is the process of adding new transactions to the Bitcoin blockchain. It’s a tough job. People who choose to mine Bitcoin use a process called proof of work, deploying computers in a race to solve mathematical puzzles that verify transactions.To entice miners to keep racing to solve the puzzles and support the overall system, the Bitcoin code rewards miners with new Bitcoins. “This is how new coins are created” and new transactions are added to the blockchain, says Okoro.

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

Python вопросы с собеседований from de


Telegram Python вопросы с собеседований
FROM USA